package com.yanqu.road.entity.activity.youxing;

import java.util.ArrayList;
import java.util.List;

public class ShanShuiGridParam {

    /**
     * 位置
     */
    private int mapIndex;
    /**
     * 格子id
     */
    private int id;
    /**
     * 购买/祈愿次数
     */
    private int buy;
    /**
     * 升级次数
     */
    private int upgrade;

    /**
     * 事件id
     */
    private int eventId;

    /**
     * 事件参数
     */
    private int eventParam;

    /**
     * 是否已处理
     */
    boolean handled;

    /**
     * 是否漂泊地图行为
     */
    boolean isDrift;

    /**
     * 缓存的buf(给二次确认事件使用)
     * 投骰子都会扣除buff次数
     */
    List<Integer> cacheBuf = new ArrayList<>();

    public ShanShuiGridParam() {
    }

    public ShanShuiGridParam(int id, int pos) {
        this.id = id;
        this.mapIndex = pos;
    }

    public ShanShuiGridParam(int id, int pos, boolean handled, boolean isDrift) {
        this.id = id;
        this.mapIndex = pos;
        this.handled = handled;
        this.isDrift = isDrift;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getBuy() {
        return buy;
    }

    public void setBuy(int buy) {
        this.buy = buy;
    }

    public int getUpgrade() {
        return upgrade;
    }

    public void setUpgrade(int upgrade) {
        this.upgrade = upgrade;
    }

    public boolean isHandled() {
        return handled;
    }

    public void setHandled(boolean handled) {
        this.handled = handled;
    }

    public int getEventId() {
        return eventId;
    }

    public void setEventId(int eventId) {
        this.eventId = eventId;
    }

    public int getMapIndex() {
        return mapIndex;
    }

    public void setMapIndex(int mapIndex) {
        this.mapIndex = mapIndex;
    }

    public int getEventParam() {
        return eventParam;
    }

    public void setEventParam(int eventParam) {
        this.eventParam = eventParam;
    }

    public boolean isDrift() {
        return isDrift;
    }

    public void setDrift(boolean drift) {
        isDrift = drift;
    }

    public List<Integer> getCacheBuf() {
        return cacheBuf;
    }

    public void setCacheBuf(List<Integer> cacheBuf) {
        this.cacheBuf = cacheBuf;
    }

    public void addUseBuf(int buffId){
        if(!this.cacheBuf.contains(buffId)){
            this.cacheBuf.add(buffId);
        }
    }

    public boolean containCacheBuf(int buffId){
        return this.cacheBuf.contains(buffId);
    }
}
